fix: A2A v1.0 protobuf compatibility for executor and message validator#67
Conversation
- Remove preserving_proto_field_name from MessageToDict (use standard camelCase) - Add always_print_fields_with_no_presence for empty field serialization - Update VALID_ROLES to ROLE_USER/ROLE_AGENT (A2A v1 enum format) - Rewrite _validate_parts() for protobuf oneof detection instead of kind discriminator - Fix process manager _find_binary to handle None return from shutil.which
- Update message validator fixtures to use ROLE_USER/ROLE_AGENT and oneof parts - Fix process manager tests to mock workspace binary detection - Add gRPC channel readiness check to MCP service integration tests - Add server health check fixtures to DV integration tests
|
✅ Documentation validation passed!
|
There was a problem hiding this comment.
Pull request overview
Aligns the SDK with the A2A v1.0 protobuf/ProtoJSON conventions (camelCase keys, SCREAMING_SNAKE_CASE enums, oneof-based Part content) so that the executor and message validator interop with messages produced by the new A2A v1 stack. This was breaking the cross-product E2E executor tests. Also bumps the bundled capiscio-core version to 2.7.0 and stabilizes a few integration tests.
Changes:
executor.py: switchMessageToDictto camelCase + always-print no-presence, and readmessageIdfrom the converted dict.validators/message.py: replacekind-discriminator validation with protobuf oneof detection acrosstext/raw/url/data, updateVALID_ROLEStoROLE_USER/ROLE_AGENT, and use camelCase optional-field lookups.- Test/infra: bump
CORE_VERSIONto 2.7.0, harden process-manager unit tests against a present dev binary, add gRPC readiness check and server health-check fixtures to integration tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| capiscio_sdk/executor.py | Use ProtoJSON camelCase when converting protobuf messages and reading messageId. |
| capiscio_sdk/validators/message.py | Rewrite parts validation for A2A v1 oneof content; update valid roles and optional-field keys to camelCase. |
| capiscio_sdk/_rpc/process.py | Bump CORE_VERSION from 2.6.0 to 2.7.0. |
| tests/unit/test_message_validator.py | Update fixtures and tests to the A2A v1 ProtoJSON format and oneof semantics. |
| tests/unit/test_process.py | Mock Path.exists for capiscio-core/bin so dev binary doesn't bypass the patched search path. |
| tests/integration/test_mcp_service.py | Add channel_ready_future readiness probe so the fixture properly skips when gRPC server is absent. |
| tests/integration/test_dv_sdk.py | Add module-scoped autouse server-health skip fixture. |
| tests/integration/test_dv_order_api.py | Require server_health_check in the anonymous-order test for consistent skipping. |
|
✅ All checks passed! Ready for review. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
✅ SDK server contract tests passed (test_server_integration.py). Cross-product scenarios are validated in capiscio-e2e-tests. |
- executor.py: use getattr fallback for message_id/messageId to handle both protobuf and non-protobuf message objects - validators/message.py: filter with part.get(f) is not None instead of f in part to avoid false positives from None-valued keys
|
✅ Documentation validation passed!
|
|
✅ All checks passed! Ready for review. |
|
✅ SDK server contract tests passed (test_server_integration.py). Cross-product scenarios are validated in capiscio-e2e-tests. |
Summary
Fixes the SDK executor and message validator to work with A2A v1.0 protobuf format (migrated from v0.3 Pydantic). This was causing all
test_real_executor.pytests to fail in CI (capiscio-e2e-tests "Cross-Product E2E Tests" job).Production Changes
executor.pypreserving_proto_field_name=TruefromMessageToDict— A2A v1 uses standard camelCase (per ADR-001 ProtoJSON serialization)always_print_fields_with_no_presence=Trueto ensure empty fields serialize correctlymessageIdinstead ofmessage_id)getattrfallback chain for identifier extraction to handle both protobuf and non-protobuf message objectsvalidators/message.pyVALID_ROLESfrom["user", "agent"]to["ROLE_USER", "ROLE_AGENT"](A2A v1 protobuf enum format)_validate_parts()to use protobuf oneof detection (checks for presence oftext/raw/url/datafields) instead of requiring akinddiscriminatorpart.get(f) is not Noneinstead off in partto avoid false positives from None-valued keyscontextId,taskId)_rpc/process.pyCORE_VERSIONfrom 2.6.0 to 2.7.0Test Changes
capiscio-core/bin/capisciowas bypassing mocked paths)Verification
All 477 tests pass locally (0 failed, 82 skipped for expected reasons like no running server/gRPC).
Breaking Changes
None.
MessageValidatorandVALID_ROLESare internal implementation details — no downstream repos import them directly. Checked: capiscio-mcp-python, a2a-demos, langchain-capiscio, capiscio-e2e-tests.